// File BaseGameEntity.cpp
//
// Purpose: Contains the implementation of the CBaseGameEntity class
//
// Author : Bryson King (edited)
// Original Code Provided by: Mat Buckland 2002 (fup@ai-junkie.com)
// Date : 18 March 2013
// --------------------------------------------------------------
#define DEBUG_SECTION

#include "BaseGameEntity.h"

#include <string>

#include "Telegram.h"
#include "IPerson.h"

#ifdef DEBUG_SECTION
#include <stdio.h>
#endif

CBaseGameEntity::CBaseGameEntity(int id)
{
	SetID(id);
}


int CBaseGameEntity::m_iNextValidID = 0;

//----------------------------- SetID -----------------------------------------
//
//  this must be called within each constructor to make sure the ID is set
//  correctly. It verifies that the value passed to the method is greater
//  or equal to the next valid ID, before setting the ID and incrementing
//  the next valid ID
//-----------------------------------------------------------------------------
void CBaseGameEntity::SetID(int val)
{
	//During debug, verify there the ID is correct
	#ifdef DEBUG_SECTION
	//make sure the val is equal to or greater than the next available ID
		if(!(val >= m_iNextValidID))
			std::cout << std::endl << "<CBaseGameEntity::SetID>: invalid ID";
	#endif

	m_ID = val;    
	m_iNextValidID = m_ID + 1;
}

CBaseGameEntity::~CBaseGameEntity()
{
}